home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 10499 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.6 KB

  1. Path: newdelph.cig.mot.com!usenet
  2. From: Martin O'Hara <oharam>
  3. Newsgroups: comp.lang.c++
  4. Subject: Question: outLined inlines/ Vtab replication
  5. Date: 8 Mar 1996 09:56:37 GMT
  6. Organization: Motorola Cellular Infrastructure Group
  7. Message-ID: <4hp08l$5sd@newdelph.cig.mot.com>
  8. NNTP-Posting-Host: liath202.cork.cig.mot.com
  9. Mime-Version: 1.0
  10. Content-Type: text/plain; charset=us-ascii
  11. Content-Transfer-Encoding: 7bit
  12. X-Mailer: Mozilla 1.1 (X11; I; SunOS 4.1.3_U1 sun4m)
  13. X-URL: news:comp.lang.c++
  14.  
  15. I have a couple of questions that Im not 100 percent on
  16.  
  17. If a function is declared inline by the programmer but the address of this
  18. function is taken in the code somewhere then the compiler will generate a
  19. callable function. This may also happpen if the inline is recursive or too big.
  20.  
  21. Q. Is a copy of such a function  placed in each translation unit in which it is
  22. needed ( code duplication). Is this an "outlined inline"?
  23.  
  24. Q. Can there exist inline expanded code representing the function and also a
  25. callable version of the function in different parts of a program.? Or will the
  26. compiler decide that if all occorrences of the function cannot be inline
  27. expanded then the function will just be a normal one?
  28.  
  29. I also have a question regarding VTABs
  30.  
  31. The C++ standard states that smart compilers will look for the first non inline
  32. virtual function definition of a class and place one copy of the VTAB in that
  33. translation unit. In what cases will the VTAB be replicated (anywhere the class
  34. h file is included) by a smart compiler. 
  35. A. If there are no non inline virtuals?
  36. B  If there are no non virtual functions in the class (C++ standard)?
  37.  
  38. /M
  39.  
  40.